/**
 * Created by LXH on 2017/10/31.
 */
import axios from './axios.js'
import qs from 'qs'
import store from'../vuex/'
import {tl} from'../mixin/tool'
import {utility} from '../assets/js/utility/utility'

export const homeService = {
    /* 获取分类列表 */
    typeList: function () {
        return axios.get('/articles/type')
    },
    /* 获取文章列表 */
    articleList: function (params) {
        return axios.get('/articles'+tl.getParam(params))
    },
    /* 获取轮播列表 */
    getbanners: function (params) {
        return axios.get('/banners'+tl.getParam(params))
    },
    /* 获取详细 */
    getArticle: function (articleId) {
        return axios.get('/articles/'+articleId)
    },
    /* 获取详细 */
    getSearch: function (params) {
        return axios.get('/search/'+tl.getParam(params))
    },
    /* 获取列表 */
    getcollect: function (params) {
        return axios.get('/users/collect/exist/'+tl.getParam(params))
    },
    /* 获取列表 */
    collect: function (params) {
        return axios.post('/articles/'+params.articleId+'/collect'+tl.getParam(params))
    },
    /* 获取列表 */
    like: function (params) {
        return axios.post('/articles/'+params.articleId+'/like'+tl.getParam(params))
    },
}
// export default {loginService}
